package com.ytjj.qmyx.admin.dao;

import com.ytjj.qmyx.admin.model.response.goods.ProductSpecResponse;
import com.ytjj.qmyx.mall.model.ProductSpec;
import org.apache.ibatis.annotations.Param;
import com.ytjj.qmyx.admin.model.response.goods.ProductSpecResponse;

import java.math.BigDecimal;
import java.util.List;

public interface ProductSpecDao {

    int queryStockSum(Integer productId);

    int updateSpecStocks(Integer stock);

    int updatePriceStock(@Param("productId") Integer productId,@Param("price") BigDecimal price,
                         @Param("stock")Integer stock,@Param("curPrice") BigDecimal curPrice);

    ProductSpec selectByProductIdAndSkuSpec(@Param("id") Integer id, @Param("skuSpec") String skuSpec);

    List<ProductSpec> selectByProductIds(@Param("productIds") List<Integer> productIds);

    int copyToProductSpec(@Param("list") List<ProductSpecResponse> list);

    int copyToProductSpecNew(@Param("list") List<ProductSpecResponse> list);

    int delProductSpecs(@Param("list") List<ProductSpecResponse> list);

    int deleteByProductId(@Param("productId") Integer productId);

    int insertProductSpecBatch(@Param("list") List<ProductSpecResponse> list);

    int insertSpecBatch(@Param("list") List<ProductSpec> list);

    int deleteSpecsByProductId(@Param("productId") Integer productId);


    int updateBySupEntity(ProductSpecResponse productSpecResponse);

    List<ProductSpec> selectBySupId(Integer supplyId);

    List<ProductSpecResponse> selectBySupIdList(@Param("supplyIdList")List<Integer> supplyIdList,@Param("idList")List<Integer> idList);

    int deleteSpecsBySupId(Integer supplyId);

    int deleteSpecsByParams(@Param("productId") Integer productId,@Param("supIds") List<Integer> supIds);

    int updateSupplyPriceBySupplyId(@Param("supplyId") Integer supplyId,@Param("supplyPrice") BigDecimal supplyPrice,@Param("costPrice") BigDecimal costPrice);
}
